#include <stdio.h>
#include <string.h>

#define ALIGN_LEN    8

int main(void)
{
    char str[1000] = {0};
    char tmp[ALIGN_LEN] = {0};

    while (1)
    {
        scanf("%s", str);

        int len = strlen(str);

        if (len < 1)
            continue;

        int pos = 0;
        int remain = len;

        while (pos < len)
        {
            if (remain < ALIGN_LEN)
            {
                int zero = ALIGN_LEN - remain;

                while (pos < len)
                {
                    printf("%c", str[pos++]);
                }

                while (zero)
                {
                    printf("0");
                    zero--;
                }
                printf("\n");

                break;
            }
            else 
            {
                for (int i=0; i<ALIGN_LEN; i++)
                {
                    printf("%c", str[pos+i]);
                }
                printf("\n");

                pos += ALIGN_LEN;
            }

            remain = len - ALIGN_LEN;
        }
    }
}
